<?php
class MenuWidget extends Widget {

    /**
     * Initializes the widgets
     */
    public function init() {
        parent::init();
    }

    /**
     * Execute the widgets
     */
    public function run() {
        Yii::beginProfile(get_class($this));

        $menu = array(
            array('label' => Lang::t('menu.dashboard'), 'url' => $this->url('acp/site/index')),
            array('label' => Lang::t('menu.order'), 'url' => $this->url('acp/order')),
            array('label' => Lang::t('menu.item'), 'url' => $this->url('acp/item'), 'items' => array(
                array('label' => Lang::t('menu.item.category'), 'url' => $this->url('acp/item/admincategory')),
                array('label' => Lang::t('menu.item.category.add'), 'url' => $this->url('acp/item/createcategory')),
                array('label' => Lang::t('menu.item.add'), 'url' => $this->url('acp/item/create')),
            )),
            array('label' => Lang::t('menu.news'), 'url' => $this->url('acp/news'), 'items' => array(
                array('label' => Lang::t('menu.news.add'), 'url' => $this->url('acp/news/create')),
            )),
            array('label' => Lang::t('menu.enquiry'), 'url' => $this->url('acp/enquiry')),            
            array('label' => Lang::t('menu.account'), 'url' => $this->url('acp/account'), 'items' => array(
                array('label' => Lang::t('menu.account.add'), 'url' => $this->url('acp/account/create')),
            )),
            
            array('label' => Lang::t('menu.user'), 'url' => $this->url('acp/user'), 'items' => array(
                array('label' => Lang::t('menu.user.add'), 'url' => $this->url('acp/user/create')),
            )),
        );

        $this->render('componentsViewPath._menuWidget', array(
            'menu' => $menu,
        ));

        Yii::endProfile(get_class($this));
    }

}//end class